﻿using FireStarterModeller.BO;
using Habanero.Faces.Base;
using Habanero.Faces.Win;

namespace FireStarterModeller.UI
{
/*    public class MainControl : UserControlWin, IFormControl
    {
//        private readonly IControlFactory _controlFactory;

        public MainControl(IControlFactory controlFactory)
        {
//            _controlFactory = controlFactory;
//
//            DMSolutionControl = new DMSolutionControl(_controlFactory);
//            DMPropertyAndRuleEditorControl = new DMPropertyAndRuleEditorControl(_controlFactory);
//            DMRelationshipsControl = new DMRelationshipsControl(_controlFactory);
//            UniqueConstraintInfosControl = new UniqueConstraintInfosControl(_controlFactory);
//            UIInfoControl = new UIInfoControl(_controlFactory);
//
//            IGroupBox businessObjectsgroupBox = controlFactory.CreateGroupBox();
//            businessObjectsgroupBox.Text = "Business Objects";
//            BorderLayoutManager businessObjectsGroupBoxLayoutManager = controlFactory.CreateBorderLayoutManager(businessObjectsgroupBox);
//            businessObjectsGroupBoxLayoutManager.AddControl(DMSolutionControl, BorderLayoutManager.Position.Centre);
//            businessObjectsgroupBox.Width = 500;
//            
//            IGroupBox relationshipInfosGroupBox = controlFactory.CreateGroupBox();
//            relationshipInfosGroupBox.Text = "Relationships";
//            BorderLayoutManager relationshipInfosGroupBoxLayoutManager = controlFactory.CreateBorderLayoutManager(relationshipInfosGroupBox);
//            relationshipInfosGroupBoxLayoutManager.AddControl(this.DMRelationshipsControl, BorderLayoutManager.Position.Centre);
//
//            ITabControl tabControl = controlFactory.CreateTabControl();
//            ITabPage propertiesTabPage = controlFactory.CreateTabPage("Properties");
//            tabControl.TabPages.Add(propertiesTabPage);
//            ITabPage alternateKeysTabPage = controlFactory.CreateTabPage("Unique Constraints");
//            tabControl.TabPages.Add(alternateKeysTabPage);
//            ITabPage uiDefTabPage = controlFactory.CreateTabPage("UI Definition");
//            tabControl.TabPages.Add(uiDefTabPage);
//
//            //IGroupBox propertyInfosGroupBox = controlFactory.CreateGroupBox();
//            //propertyInfosGroupBox.Text = "Properties";
//            BorderLayoutManager propertyInfosGroupBoxLayoutManager = controlFactory.CreateBorderLayoutManager(propertiesTabPage);
//            propertyInfosGroupBoxLayoutManager.AddControl(this.DMPropertyAndRuleEditorControl, BorderLayoutManager.Position.Centre);
//
//            //IGroupBox alternateKeyInfosGroupBox = controlFactory.CreateGroupBox();
//            //alternateKeyInfosGroupBox.Text = "Alternate Keys";
//            BorderLayoutManager alternateKeyInfosGroupBoxLayoutManager = controlFactory.CreateBorderLayoutManager(alternateKeysTabPage);
//            alternateKeyInfosGroupBoxLayoutManager.AddControl(this.UniqueConstraintInfosControl, BorderLayoutManager.Position.Centre);
//
//            BorderLayoutManager uiDefGroupBoxLayoutManager = controlFactory.CreateBorderLayoutManager(uiDefTabPage);
//            uiDefGroupBoxLayoutManager.AddControl(this.UIInfoControl, BorderLayoutManager.Position.Centre);
//
//            //GridLayoutManager layoutManager = new GridLayoutManager(this, _controlFactory);
//            //layoutManager.SetGridSize(2, 11);
//            //layoutManager.AddControl(businessObjectsgroupBox, 1, 5);
//            //layoutManager.AddControl(relationshipInfosGroupBox, 1, 6);
//            //layoutManager.AddControl(propertyInfosGroupBox, 1, 11);
//
//            IPanel topPanel = _controlFactory.CreatePanel(_controlFactory);
//            BorderLayoutManager topPanelLayoutManager = _controlFactory.CreateBorderLayoutManager(topPanel);
//            topPanelLayoutManager.AddControl(businessObjectsgroupBox, BorderLayoutManager.Position.West);
//            topPanelLayoutManager.AddControl(relationshipInfosGroupBox, BorderLayoutManager.Position.Centre);
//            topPanel.Height = 300; // 350;
//
//            BorderLayoutManager layoutManager = _controlFactory.CreateBorderLayoutManager(this);
//            layoutManager.AddControl(topPanel, BorderLayoutManager.Position.North);
//            layoutManager.AddControl(tabControl, BorderLayoutManager.Position.Centre);
//
//            this.DMSolutionControl.ClassSelected += delegate
//            {
//                DMClass selectedDMClass = DMSolutionControl.SubClass;
//                DMPropertyAndRuleEditorControl.SubClass = selectedDMClass;
//                DMRelationshipsControl.SubClass = selectedDMClass;
//                UniqueConstraintInfosControl.SubClass = selectedDMClass;
//                UIInfoControl.SubClass = selectedDMClass;
//            };
//
//            this.Enabled = false;
        }

 //       public DMSolutionControl DMSolutionControl { get; set; }
//        public DMPropertyAndRuleEditorControl DMPropertyAndRuleEditorControl { get; set; }
        //public DMRelationshipsControl DMRelationshipsControl { get; set; }
//        public UniqueConstraintInfosControl UniqueConstraintInfosControl { get; set; }
       // public UIInfoControl UIInfoControl { get; set; }
/*
        public DMSolution Solution
        {
            get { return DMSolutionControl.Solution;  }
            set { 
                DMSolutionControl.Solution = value;
                this.Enabled = (value != null);
            }
        }♥1♥



        public void SetForm(IFormHabanero form)
        {
            
        }
    }*/
}
